﻿$(document).ready(function () {
    var price = parseInt($('.order-price span').text());
    var count = parseInt($('.goods-count').text());
    var total = price * count;
    $('#price').append("<span> ￥" + total + "</span>")
    $('.total-amount').append("<span> ￥" + total + "</span>")
    $('.cope').append("<span> ￥" + total + "</span>")
    ArriveBar(parseInt($('#order_state').val()));
})

function ArriveBar(state){
    switch (state) {
        case 5: {
            $('.order-detail-state').css({ 'background-color': '#00c3f5', 'color': 'white' });
        }; break;
        case 4: {
            $('.order-state-02').css({ 'border-top-right-radius': '0px', 'border-bottom-right-radius': '0px' });
            $('.order-state-03').addClass('arrive');
            $('.order-state-03').css({ 'border-top-left-radius': '0px', 'border-bottom-left-radius': '0px' });
        };
        case 3:;
        case 2: {
            $('.order-state-01').css({ 'border-top-right-radius': '0px', 'border-bottom-right-radius': '0px' });
            $('.order-state-02').addClass('arrive');
            $('.order-state-02').css({ 'border-top-left-radius': '0px', 'border-bottom-left-radius': '0px' });
        };
        case 1: $('.order-state-01').addClass('arrive'); break;
    }
    console.log(1);
}